const readline = require('readline-sync'); 
var n = readline.question("请输入n的值：");
function getX(n){
    var s = 0;
    for(var i=0;i<=n;i++){
        var xx = i*i+'';
        if(xx.endsWith(i)){
            s++;
            console.log(i);
        }
    }
    return s;
}
if(n){
    console.log(getX(n))
}
